/* Tab样式 - 根据图片效果优化 */

/* 移除首页主容器的边框 - 使用最高优先级 */
.container.relative.mx-auto > .flex.flex-col,
.container > .flex.flex-col,
.flex.flex-col,
div.flex.flex-col {
  border: 0 !important;
  border-width: 0 !important;
  border-style: none !important;
  outline: 0 !important;
  outline-width: 0 !important;
  outline-style: none !important;
  box-shadow: none !important;
}

/* 新的顶部水平导航样式 - 参考old-nav的tab-menu */
.top-navigation {
  width: 100%;
  background: transparent !important; /* 改为透明，由tab-wrapper提供背景 */
  border-bottom: none !important; /* 移除边框 */
  box-shadow: none !important; /* 移除阴影 */
  position: static !important; /* 不再使用sticky定位 */
  z-index: 19;
  margin: 0 auto;
}

.top-nav-container {
  max-width: none !important; /* 移除最大宽度限制 */
  margin: 0 auto;
  padding: 0 20px !important; /* 添加左右20px的内边距 */
  overflow-x: auto; /* 启用水平滚动 */
  overflow-y: hidden;
  /* 隐藏滚动条 */
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* 移动端滚动优化 */
  -webkit-overflow-scrolling: touch;
  /* 鼠标样式提示 */
  cursor: grab;
}

.top-nav-container:active {
  cursor: grabbing;
}

.top-nav-container::-webkit-scrollbar {
  display: none; /* 隐藏滚动条 */
}

.horizontal-nav-tabs {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 48px !important;
  gap: 0 !important;
  min-width: max-content !important; /* 确保内容不会被压缩 */
}

.nav-tab-item {
  position: relative !important;
  background-color: transparent !important;
  color: #454444 !important; /* 参考old-nav的颜色 */
  display: inline-block !important; /* 改为inline-block，与old-nav一致 */
  padding: 18px 21px 22px 21px !important; /* 1920px+基准：21px左右padding (18px * 1.17) */
  cursor: pointer !important;
  white-space: nowrap !important;
  font-size: 19px !important; /* 1920px+基准：19px字体 (16px * 1.19) */
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
  border: none !important;
  text-align: center !important;
  box-sizing: border-box !important;
  opacity: 0.8 !important; /* 参考old-nav的透明度 */
  flex-shrink: 0 !important; /* 防止内容被压缩 */
  z-index: 0 !important;
}

.nav-tab-item:hover {
  color: #1CC3EA !important; /* 参考old-nav的悬停颜色 */
  background: transparent !important;
}

.nav-tab-item.active {
  color: #232222 !important; /* 参考old-nav的活跃颜色 */
  background: transparent !important;
  font-weight: 600 !important;
  opacity: 1 !important;
}

.nav-tab-item.active:hover {
  color: #232222 !important;
  background: transparent !important;
}

.active-line {
  position: absolute !important;
  border-radius: 20px !important; /* 参考old-nav的圆角 */
  height: 8px !important; /* 参考old-nav的高度 */
  background: linear-gradient(-20deg, #1CC3EA 0%, #91F5D6 100%, #91F5D6 100%) !important; /* 参考old-nav的渐变 */
  bottom: 8px !important; /* 更贴近tab-title，实现old-nav的紧密效果 */
  left: 0 !important;
  transform: none !important;
  transition: width 0.3s ease !important;
}

/* 侧边栏内水平导航样式 */
.sidebar-horizontal {
  width: 16rem;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background: #ffffff;
  overflow: hidden;
  border-right: 1px solid #e5e7eb;
  z-index: 15;  /* 使用 sidebar 层级 */
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.tab-container {
  padding: 20px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  height: 100%;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.tab-container::-webkit-scrollbar {
  height: 3px;
}

.tab-container::-webkit-scrollbar-track {
  background: transparent;
}

.tab-container::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}

/* 水平tab菜单样式 - 参考图片效果 */
.horizontal-in-sidebar {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  min-width: max-content !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: flex-start !important;
  border-bottom: 2px solid #f3f4f6 !important;
  padding-bottom: 8px !important;
}

.horizontal-in-sidebar .tab-item {
  position: relative !important;
  background-color: transparent !important;
  color: #6b7280 !important;
  display: inline-block !important;
  padding: 8px 16px !important;
  opacity: 1 !important;
  cursor: pointer !important;
  border-radius: 0 !important;
  white-space: nowrap !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
  border: none !important;
  min-width: auto !important;
  text-align: center !important;
  margin-bottom: 8px !important;
}

.horizontal-in-sidebar .tab-item:hover {
  color: #1f2937 !important;
  background: transparent !important;
}

.horizontal-in-sidebar .tab-item.active {
  color: #1f2937 !important;
  opacity: 1 !important;
  background: transparent !important;
  font-weight: 600 !important;
}

.horizontal-in-sidebar .tab-item.active:hover {
  color: #1f2937 !important;
}

.horizontal-in-sidebar .line {
  position: absolute !important;
  border-radius: 2px !important;
  height: 3px !important;
  background: #3b82f6 !important;
  bottom: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  transition: width 0.3s ease !important;
}

.tab-title {
  font-size: inherit !important;      /* 继承父元素字体大小 */
  font-weight: inherit !important;    /* 继承父元素字体粗细 */
  color: inherit !important;          /* 继承父元素颜色 */
  margin-bottom: 0 !important;        /* 移除不必要的下边距 */
  display: inline !important;         /* 确保内联显示 */
}

/* 兼容性：tab-content区域 */
.tab-content {
  width: 100% !important;
}

.tab-content > .tab-panel {
  display: none !important;
  width: 100% !important;
  height: auto !important;
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}

.tab-panel.hidden {
  display: none !important;
}

.tab-panel.active {
  display: block !important;
  opacity: 1 !important;
}

/* 基础网格容器 - 以1920px+为基准 */
.grid-container {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important; /* 1920px+基准：6列 */
  gap: 18px !important; /* 1920px+基准：18px间距 */
  width: 100% !important;
  padding: 0 !important; 
  max-width: 1400px !important; /* 1920px+基准：最大宽度限制 */
  margin: 0 auto !important; /* 1920px+基准：居中显示 */
}

/* 基础网格项目 - 以1920px+为基准 */
.grid-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  padding: 20px 12px 24px 12px !important; /* 1920px+基准 */
  border-radius: 8px !important; 
  transition: all 0.3s ease !important;
  background: #ffffff !important;
  border: none !important;
  min-width: 90px !important; /* 1920px+基准 */
  min-height: 120px !important; /* 1920px+基准 */
}

.grid-item:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  border-color: #e5e7eb !important;
}

.grid-item a {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-decoration: none !important;
  color: #374151 !important;
  width: 100% !important;
}

.grid-item a:hover {
  color: #1f2937 !important;
}

/* 基础网格图标 - 以1920px+为基准 */
.grid-icon {
  width: 80px !important; /* 1920px+基准 */
  height: 80px !important; /* 1920px+基准 */
  border-radius: 8px !important;
  object-fit: contain !important;
  margin-bottom: 14px !important;
  transition: transform 0.3s ease !important;
}

.grid-icon:hover {
  transform: scale(1.05) !important;
}

/* 基础网格标题 - 以1920px+为基准 */
.grid-title {
  font-size: 15px !important; /* 1920px+基准 */
  font-weight: 500 !important;
  line-height: 1.4 !important;
  color: #374151 !important;
  text-align: center !important;
  word-break: break-word !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
}

/* 已移除分类标题样式 */

/* 兼容性：保留lyimg样式但隐藏 */
.lyimg-container {
  display: none !important;
}

.lyimg {
  display: none !important;
}

.pic {
  display: none !important;
}

.item-title {
  display: none !important;
}

/* =============================================== */
/* 响应式适配 - 基于1920px+向下兼容 - 精细化调整版本 */
/* =============================================== */

/* 大桌面 1600px-1919px - 优化图标和间距 */
@media screen and (min-width: 1600px) and (max-width: 1919px) {
  .grid-container {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 16px !important;
    max-width: 1200px !important;
  }
  
  .grid-item {
    min-width: 88px !important; /* 增加2px */
    min-height: 118px !important; /* 增加3px */
    padding: 18px 12px 22px 12px !important; /* 增加左右padding */
  }
  
  .grid-icon {
    width: 74px !important; /* 增加2px */
    height: 74px !important;
    margin-bottom: 12px !important; /* 减少间距 */
  }
  
  .grid-title {
    font-size: 14px !important;
    line-height: 1.3 !important; /* 优化行高 */
  }
  
  .nav-tab-item {
    padding: 16px 21px 20px 21px !important; /* 21px左右padding (18px * 1.17) */
    font-size: 18px !important; /* 18px字体 (15px * 1.2) */
  }
}

/* 标准桌面 1366px-1599px - 笔记本主力优化 */
@media screen and (min-width: 1366px) and (max-width: 1599px) {
  .grid-container {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 15px !important; /* 增加1px间距 */
    max-width: 1050px !important; /* 增加最大宽度 */
  }
  
  .grid-item {
    min-width: 82px !important; /* 增加2px */
    min-height: 112px !important; /* 增加2px */
    padding: 16px 10px 20px 10px !important; /* 增加左右padding */
  }
  
  .grid-icon {
    width: 66px !important; /* 增加2px */
    height: 66px !important;
    margin-bottom: 12px !important; /* 优化间距 */
  }
  
  .grid-title {
    font-size: 13px !important;
    line-height: 1.3 !important;
  }
  
  .nav-tab-item {
    padding: 14px 18px 18px 18px !important; /* 18px左右padding (16px * 1.125) */
    font-size: 16px !important; /* 16px字体 (14px * 1.14) */
  }
}

/* 小桌面 1200px-1365px - 优化为6列布局 */
@media screen and (max-width: 1365px) and (min-width: 1200px) {
  .grid-container {
    grid-template-columns: repeat(6, 1fr) !important; /* 改为6列 */
    gap: 12px !important; /* 适当减少间距以容纳6列 */
    max-width: 1000px !important; /* 调整最大宽度 */
  }
  
  .grid-item {
    min-width: 70px !important; /* 调整宽度适应6列 */
    min-height: 100px !important; /* 调整高度 */
    padding: 12px 6px 16px 6px !important; /* 调整padding */
  }
  
  .grid-icon {
    width: 54px !important; /* 调整图标尺寸 */
    height: 54px !important;
    margin-bottom: 10px !important; /* 优化间距 */
  }
  
  .grid-title {
    font-size: 12px !important;
    line-height: 1.3 !important;
  }
  
  .nav-tab-item {
    padding: 12px 16px 16px 16px !important; /* 16px左右padding (14px * 1.14) */
    font-size: 15px !important; /* 15px字体 (13px * 1.15) */
  }
}

/* 笔记本 1024px-1199px - 优化为6列布局 */
@media screen and (max-width: 1199px) and (min-width: 1024px) {
  .grid-container {
    grid-template-columns: repeat(6, 1fr) !important; /* 改为6列 */
    gap: 10px !important; /* 减少间距以容纳6列 */
    max-width: 900px !important; /* 调整最大宽度 */
  }
  
  .grid-item {
    min-width: 62px !important; /* 调整宽度适应6列 */
    min-height: 92px !important; /* 调整高度 */
    padding: 10px 4px 14px 4px !important; /* 调整padding */
  }
  
  .grid-icon {
    width: 46px !important; /* 调整图标尺寸 */
    height: 46px !important;
    margin-bottom: 9px !important; /* 优化间距 */
  }
  
  .grid-title {
    font-size: 11px !important; /* 调整字体大小 */
    line-height: 1.3 !important;
  }
  
  .nav-tab-item {
    padding: 10px 13px 14px 13px !important; /* 13px左右padding (12px * 1.08) */
    font-size: 13px !important; /* 13px字体 (12px * 1.08) */
  }
}

/* 平板 768px-1023px - 优化为5列布局 */
@media screen and (max-width: 1023px) and (min-width: 768px) {
  .grid-container {
    grid-template-columns: repeat(5, 1fr) !important; /* 改为5列 */
    gap: 10px !important; /* 适当减少间距以容纳5列 */
    max-width: 100% !important;
    padding: 0 12px !important; /* 增加左右padding */
  }
  
  .grid-item {
    min-width: 58px !important; /* 调整宽度适应5列 */
    min-height: 88px !important; /* 调整高度 */
    padding: 9px 3px 13px 3px !important; /* 调整padding */
  }
  
  .grid-icon {
    width: 40px !important; /* 调整图标尺寸 */
    height: 40px !important;
    margin-bottom: 8px !important; /* 优化间距 */
  }
  
  .grid-title {
    font-size: 10px !important; /* 调整字体大小 */
    line-height: 1.2 !important;
  }
  
  .nav-tab-item {
    padding: 8px 10px 12px 10px !important; /* 保持导航padding */
    font-size: 11px !important;
  }
  
  .active-line {
    bottom: -2px !important; /* 保持与最大屏幕14px间距一致 (12px - 14px = -2px) */
  }
}

/* 大手机 601px-767px - 优化为4列布局 */
@media screen and (max-width: 767px) and (min-width: 601px) {
  .grid-container {
    grid-template-columns: repeat(4, 1fr) !important; /* 改为4列 */
    gap: 8px !important; /* 适当减少间距以容纳4列 */
    max-width: 100% !important;
    padding: 0 10px !important; /* 调整左右padding */
  }
  
  .grid-item {
    min-width: 48px !important; /* 调整宽度适应4列 */
    min-height: 78px !important; /* 调整高度 */
    padding: 7px 2px 11px 2px !important; /* 调整padding */
  }
  
  .grid-icon {
    width: 34px !important; /* 调整图标尺寸 */
    height: 34px !important;
    margin-bottom: 7px !important; /* 优化间距 */
  }
  
  .grid-title {
    font-size: 9px !important; /* 调整字体大小 */
    line-height: 1.2 !important;
  }
  
  .nav-tab-item {
    padding: 6px 8px 10px 8px !important; /* 保持导航padding */
    font-size: 10px !important;
  }
  
  .active-line {
    bottom: -4px !important; /* 保持与最大屏幕14px间距一致 (10px - 14px = -4px) */
  }
}

/* 小手机 401px-600px - 3列布局保持可用性 */
@media screen and (max-width: 600px) and (min-width: 401px) {
  .grid-container {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important; /* 增加2px间距 */
    max-width: 100% !important;
    padding: 0 10px !important; /* 增加左右padding */
  }
  
  .grid-item {
    min-width: 55px !important; /* 增加5px */
    min-height: 80px !important; /* 增加5px */
    padding: 6px 2px 10px 2px !important; /* 增加左右padding */
  }
  
  .grid-icon {
    width: 36px !important; /* 增加4px */
    height: 36px !important;
    margin-bottom: 7px !important; /* 优化间距 */
  }
  
  .grid-title {
    font-size: 9px !important; /* 增加1px字体 */
    line-height: 1.2 !important;
  }
  
  .nav-tab-item {
    padding: 4px 6px 8px 6px !important; /* 增加左右padding */
    font-size: 9px !important;
  }
  
  .active-line {
    bottom: -6px !important; /* 保持与最大屏幕14px间距一致 (8px - 14px = -6px) */
  }
}

/* 极小手机 ≤400px - 保持最小可用性 */
@media screen and (max-width: 400px) {
  .grid-container {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important; /* 增加2px间距 */
    max-width: 100% !important;
    padding: 0 8px !important; /* 增加左右padding */
  }
  
  .grid-item {
    min-width: 50px !important; /* 增加5px */
    min-height: 72px !important; /* 增加5px */
    padding: 4px 1px 8px 1px !important; /* 增加左右padding */
  }
  
  .grid-icon {
    width: 32px !important; /* 增加4px */
    height: 32px !important;
    margin-bottom: 6px !important; /* 优化间距 */
  }
  
  .grid-title {
    font-size: 8px !important; /* 增加1px字体 */
    line-height: 1.1 !important;
  }
  
  .nav-tab-item {
    padding: 3px 5px 6px 5px !important; /* 增加左右padding */
    font-size: 8px !important;
    min-height: 34px !important; /* 增加高度 */
  }
  
  .active-line {
    bottom: -8px !important; /* 保持与最大屏幕14px间距一致 (6px - 14px = -8px) */
  }
  
  .top-nav-container {
    padding: 0 12px !important; /* 增加左右padding */
  }
  
  .horizontal-nav-tabs {
    min-height: 30px !important; /* 增加高度 */
  }
}

/* 平板端导航适配 */
@media screen and (max-width: 768px) {
  .top-navigation {
    top: 64px !important;
  }
}

/* old-nav风格的tab-wrapper样式 */
.tab-wrapper {
  margin: 16px auto !important;
  min-width: 310px !important;
  width: 50% !important; /* 1920px+基准：50% */
  height: auto !important;
  box-shadow: 0 0 30px rgba(78, 70, 70, 0.16) !important;
  -webkit-box-shadow: 0 0 30px rgba(78, 70, 70, 0.16) !important;
  border-radius: 20px !important;
  padding-left: 20px !important;
  font-size: 16px !important;
  overflow: hidden !important;
  padding-bottom: 10px !important;
  background-color: #ffffff !important;
}

/* old-nav风格的tab-content样式 */
.tab-content {
  background-color: #fff !important;
  box-sizing: border-box !important;
  width: 100% !important;
  padding: 20px 50px 20px 50px !important; /* 1920px+基准：左右各50px */
  min-height: 180px !important;
}

/* tab-wrapper响应式宽度适配 - 精细化调整 */
@media screen and (max-width: 1599px) {
  .tab-wrapper {
    width: 58% !important; /* 增加3% */
  }
}

@media screen and (max-width: 1365px) {
  .tab-wrapper {
    width: 68% !important; /* 增加3% */
  }
}

@media screen and (max-width: 1199px) {
  .tab-wrapper {
    width: 78% !important; /* 增加3% */
  }
}

@media screen and (max-width: 1023px) {
  .tab-wrapper {
    width: 88% !important; /* 增加3% */
  }
  
  .tab-content {
    padding: 18px 15px 18px 15px !important; /* 增加padding */
  }
}

@media screen and (max-width: 767px) {
  .tab-wrapper {
    width: 96% !important; /* 增加1% */
  }
  
  .tab-content {
    padding: 15px 12px 15px 12px !important; /* 增加左右padding */
  }
}

@media screen and (max-width: 600px) {
  .tab-wrapper {
    width: 98% !important;
  }
  
  .tab-content {
    padding: 12px 10px 12px 10px !important; /* 增加上下padding */
  }
}

@media screen and (max-width: 400px) {
  .tab-wrapper {
    width: 99% !important; /* 增加1% */
  }
  
  .tab-content {
    padding: 10px 8px 10px 8px !important;
  }
}

/* 暗色主题样式 */
.dark .tab-wrapper {
  background-color: hsl(var(--card)) !important;
  /* 升级版：大幅增强边框清晰度和边界感 */
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
  -webkit-box-shadow: 0 0 30px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
  /* 为右边框预留空间，防止被内容遮挡，与左侧padding保持对称 */
  padding-right: 20px !important;
}

.dark .tab-content {
  background-color: hsl(var(--card)) !important;
}

.dark .grid-item {
  background: hsl(var(--card)) !important;
  border: 1px solid hsl(var(--border)) !important;
}

.dark .grid-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  border-color: hsl(var(--border)) !important;
}

.dark .grid-item a {
  color: hsl(var(--foreground)) !important;
}

.dark .grid-item a:hover {
  color: hsl(var(--foreground)) !important;
}

.dark .grid-title {
  color: hsl(var(--foreground)) !important;
}

.dark .nav-tab-item {
  color: hsl(var(--muted-foreground)) !important;
}

.dark .nav-tab-item:hover {
  color: hsl(var(--foreground)) !important;
}

.dark .nav-tab-item.active {
  color: hsl(var(--foreground)) !important;
}

.dark .nav-tab-item.active:hover {
  color: hsl(var(--foreground)) !important;
}

.dark .tab-content > .tab-panel {
  background-color: hsl(var(--card)) !important;
}

.dark .sidebar-horizontal {
  background: hsl(var(--card)) !important;
  border-right: 1px solid hsl(var(--border)) !important;
}

.dark .horizontal-in-sidebar {
  border-bottom: 2px solid hsl(var(--border)) !important;
}

.dark .horizontal-in-sidebar .tab-item {
  color: hsl(var(--muted-foreground)) !important;
}

.dark .horizontal-in-sidebar .tab-item:hover {
  color: hsl(var(--foreground)) !important;
}

.dark .horizontal-in-sidebar .tab-item.active {
  color: hsl(var(--foreground)) !important;
}

.dark .tab-title {
  color: inherit !important;          /* 暗色主题下继承父元素颜色 */
} 